package model

import "gorm.io/gorm"

type Video struct {
	gorm.Model
	Title     string  `gorm:"type:varchar(30);comment:视频标题"`
	Intro     string  `gorm:"type:varchar(255);comment:视频简介"`
	Image     string  `gorm:"type:varchar(255);comment:封面图片"`
	Cation    string  `gorm:"type:varchar(30);comment:分类"`
	Region    string  `gorm:"type:varchar(50);comment:地区"`
	Year      string  `gorm:"type:varchar(30);comment:年份"`
	ViewCount int64   //观看数量
	LikeCount int64   //点赞数量
	Collect   int64   //收藏数量
	ComCount  int64   //评论数量
	Host      float64 `gorm:"type:decimal(10,2);comment:热度值"`
}

type Episode struct {
	gorm.Model
	VideoId    int64
	Title      string `gorm:"type:varchar(30);comment:剧集标题"`
	EpisodeNum string `gorm:"type:varchar(20);comment:集数"`
	Duration   string `gorm:"type:varchar(30);comment:时长"`
}

type History struct {
	gorm.Model
	UserId    int64  //关联用户ID
	VideoId   int64  //关联视频ID
	EpisodeId int64  //关联剧集ID
	Progress  int64  //观看时长
	WatchTime string //更新为当前时间
}

type Host struct {
	gorm.Model
	ViewCount int64   //观看数量
	LikeCount int64   //点赞数量
	Collect   int64   //收藏数量
	ComCount  int64   //评论数量
	HostNum   float64 `gorm:"type:decimal(10,2)"`
}
